show databases;

use exam;

show tables;

CREATE table account(
id int primary KEY auto_increment,
name varchar(20) not null,
money decimal(7,2)
);

select *from account;

insert into account(name,money) values('张三',3000);
insert into account(name,money) values('李四',1000);
ROLLBACK;

BEGIN;
UPDATE account set money=money-1000 where name='张三';

UPDATE account set money=money+1000 where name='李四';
ROLLBACK;


select *from account;


COMMIT;


UPDATE account set money=1000;
UPDATE account set money=3000 where name='张三';

select @@autocommit;

set @@autocommit=1;

DELETE from account where NAME='张三'or name='李四';

